package org.finesys.ai.constants;

import lombok.Getter;

import java.util.Arrays;

/**
 * 模型供应商
 */
@Getter
public enum ModelProviderEnum {

    OPEN_AI("openai"),
    DEEPSEEK("deepSeek"),
    OLLAMA("ollama"),
    ZHI_PU("zhipu"),
    DOU_BAO("doubao"),
    INTERN_LM("internlm"),
    INTERN_CHAT("internchat"),
    INTERN_MAX("internmax"),
    TONG_YI("tongyi"),
    SPARK("spark"),
    MOON_SHOT("moonsot"),
    WEN_XIN("wenxin"),
    CHAT_GLM("chatglm");

    private String name;


    private ModelProviderEnum(String name) {
        this.name = name;
    }

    /**
     * 获取enum对象,如果不存在则返回OPEN_AI
     */
    public static ModelProviderEnum getEnum(String name) {
        return Arrays.stream(ModelProviderEnum.values()).filter(model -> model.getName().equals(name)).findFirst().orElse(OPEN_AI);
    }
}
